﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace Fraction
{
    [TestFixture]
   public class TestFraction
    {
        
        [Test]
        public void DoTestFix()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(31, 14)));
        }
        [Test]
        public void DoTestFix1()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(1, 14)));
        }
        [Test]
        public void DoTestFix2()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(1, 14)));
        }
        [Test]
        public void DoTestFix3()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(1, 14)));
        }
        [Test]
        public void DoTestFix4()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(1, 14)));
        }
        [Test]
        public void DoTestFix5()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(31, 14)));
        }
        [Test]
        public void DoTestFix6()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(1, 14)));
        }
        [Test]
        public void DoTestSub()
        {
            CFraction ps1 = new CFraction(5, 2);
            CFraction ps2 = new CFraction(2, 7);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(31, 14)));
        }
        [Test]
        public void DoTestAdd()
        {
            CFraction ps1 = new CFraction(1, 2);
            CFraction ps2 = new CFraction(1, 2);
            Assert.That(ps1 + ps2, Is.EqualTo(new CFraction(3, 1)));
        }
      
       
       
        
       

        [Test]
        public void DoTestNew()
        {
            CFraction ps1 = new CFraction(10, 5);
            CFraction ps2 = new CFraction(4, 4);
            Assert.That(ps1 - ps2, Is.EqualTo(new CFraction(3, 3)));
        }
        [Test]
        [Category("Category2")]
        public void DoTestMul()
        {
            CFraction ps1 = new CFraction(1, 2);
            CFraction ps2 = new CFraction(2, 3);
            Assert.That((ps1 * ps2), Is.EqualTo(new CFraction(1, 6)));
        }
        [Test]
        [Category("Category2")]
        public void DoTestMul1()
        {
            CFraction ps1 = new CFraction(1, 2);
            CFraction ps2 = new CFraction(2, 3);
            Assert.That((ps1 * ps2), Is.EqualTo(new CFraction(1, 6)));
        }
        
        [Test]
        [Category("Category1")]
        public void DoTestDiv()
        {
            CFraction ps1 = new CFraction(1, 2);
            CFraction ps2 = new CFraction(2, 3);
            Assert.That((ps1 / ps2), Is.EqualTo(new CFraction(3, 4)));
        }
        
        [Test]
        [ExpectedException()]
        public void DoTestBayBa()
        {
            int a = 1;
            int b = 0;
            int c = a / b;
        }
        
       
        
    }
   


}
